home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Mastering Web Site Development
/
Microsoft Mastering Web Site Development (Microsoft) (1997).iso
/
Labs
/
StateUFinal
/
global.asa
< prev
next >
Wrap
Text File
|
1997-04-24
|
2KB
|
49 lines
<SCRIPT LANGUAGE="VBScript" RUNAT="Server">
Sub Session_OnStart
'==Visual InterDev Generated - DataConnection startspan==
'--Project Data Connection
Session("StateU_ConnectionString") = "DSN=StateU;UID=sa;PWD=;"
Session("StateU_ConnectionTimeout") = 15
Session("StateU_CommandTimeout") = 30
Session("StateU_RuntimeUserName") = "sa"
Session("StateU_RuntimePassword") = ""
'==Visual InterDev Generated - DataConnection endspan==
Application.Lock
Application("hitcounter")=Application("hitcounter")+1
Application.Unlock
'if they haven't hit the profile page, redirect them there
startPage = "/StateUFinal/profile.asp"
currentPage = Request.ServerVariables("SCRIPT_NAME")
Session("requestedPage") = currentpage
' Do a case-insensitive compare, and if they
' don't match, send the user to the start page.
if strcomp(currentPage,startPage,1) then
Response.Redirect(startPage)
end if
End Sub
Sub Application_OnStart
Dim fs, txtFile
Set fs = CreateObject("Scripting.FileSystemObject")
hitfile = "c:\hitcounter.txt"
Set txtFile = fs.OpenTextFile(hitfile)
Application.Lock
Application("hitcounter") = txtFile.ReadLine
Application.Unlock
txtFile.Close
End sub
Sub Application_OnEnd
Dim fs, txtFile
Set fs = CreateObject("Scripting.FileSystemObject")
hitfile = "c:\hitcounter.txt"
Set txtFile = fs.CreateTextFile(hitfile, True)
txtFile.WriteLine(Application("hitcounter"))
txtFile.Close
End Sub
</SCRIPT>